.TH tpkg 1 "October 2009"

.SH NAME

.B tpkg
\- Application package management and deployment

.SH SYNOPSIS

.B tpkg
.RB [ --servers | \-s
.IR SERVERS ]
.RB [ --group | \-g
.IR GROUP ]
.RB [ --make | \-m
.IR DIRECTORY ]
.RB [ --extract | \-x
.IR DIRECTORY ]
.RB [ --download
.IR PACKAGES ]
.RB [ --install | \-i
.IR PACKAGES ]
.RB [ --upgrade | \-u
.IR PACKAGES ]
.RB [ --ua ]
.RB [ --remove | \-r
.IR PACKAGES ]
.RB [ --rd
.IR PACKAGES ]
.RB [ --rp
.IR PACKAGES ]
.RB [ --ra ]
.RB [ --verify | \-V ]
.RB [ --start
.IR NAME ]
.RB [ --stop
.IR NAME ]
.RB [ --restart
.IR NAME ]
.RB [ --reload
.IR NAME ]
.RB [ --status
.IR NAME ]
.RB [ --start-all
.IR NAME ]
.RB [ --stop-all
.IR NAME ]
.RB [ --restart-all
.IR NAME ]
.RB [ --reload-all
.IR NAME ]
.RB [ --exec-init
.IR NAME ]
.RB [ --init-script
.IR NAME ]
.RB [ --init-cmd
.IR NAME ]
.RB [ --query | \-q
.IR NAMES ]
.RB [ --qs
.IR NAME ]
.RB [ --qa ]
.RB [ --qas ]
.RB [ --qi
.IR NAME ]
.RB [ --qis
.IR NAME ]
.RB [ --ql
.IR NAME ]
.RB [ --qls
.IR NAME ]
.RB [ --qf
.IR FILE ]
.RB [ --qr
.IR NAME ]
.RB [ --qd
.IR NAME ]
.RB [ --qds
.IR NAME ]
.RB [ --dw
.IR INTEGER ]
.RB [ --qX
.IR NAME ]
.RB [ --qXs
.IR NAME ]
.RB [ --history ]
.RB [ --qenv ]
.RB [ --qconf ]
.RB [ --base
.IR BASE ]
.RB [ --source
.IR SOURCE ]
.RB [ --no-prompt | \-n ]
.RB [ --quiet ]
.RB [ --no-sudo ]
.RB [ --lock-force ]
.RB [ --force-replace ]
.RB [ --force ]
.RB [ --out | \-o
.IR DIR ]
.RB [ --skip-remove-stop ]
.RB [ --use-ssh-key ]
.RB [ --deploy-as
.IR USERNAME ]
.RB [ --debug ]
.RB [ --version ]
.RB [ --help | \-h ]

.SH DESCRIPTION

Tpkg is a tool for packaging and deploying applications. It is designed
to work alongside your operating system's packaging tool. The deployment
features in tpkg are designed to scale to deployments across hundreds or
thousands of systems.

.SH OPTIONS
.TP
.BI --servers|-s " SERVERS"
Switches
.B tpkg
to deployment mode rather than local mode.  Specifies the server(s) to
operate against in deployment mode.  Servers are specified as a
comma-separated list. Alternatively, this option takes in a file name
that contains the list of servers (newline as the delimiter)
.B Tpkg
will connect to each server via ssh and perform the requested operation.
SSH and sudo password prompts will be handled.
.TP
.BI --group|-g " GROUP"
Specifies a group of servers to operate against in deployment mode. Server
names are obtained by running the host_group_script from tpkg.conf with the
group names as arguments.
.TP
.BI --make|\-m " DIRECTORY"
Make a package from the specified directory.  The directory must contain
at a minimum a tpkg.xml file.
.TP
.BI --extract|\-x " DIRECTORY"
Extract the metadata from a directory of packages to metadata.xml.  The
client expects source directories to have this operation performed on
them so that it can resolve dependencies without having to download all
packages.
.TP
.BI --download " PACKAGES"
Download the specified package(s).  Packages may be specified as name,
name=version, name=version=packageversion, or as a filename or URL.
.TP
.BI --install|\-i " PACKAGES"
Install the specified package(s).  Packages may be specified as name,
name=version, name=version=packageversion, or as a filename or URL.  The
equals signs may also be inequalities, for example ruby>=1.9
.TP
.BI --upgrade|\-u " PACKAGES"
Upgrade the specified package(s).  Packages specified as with --install.
If a specific version is not specified then the packages are upgraded to
the latest available.
.TP
.B --ua
Upgrade all packages to the latest available version.
.TP
.BI --remove|\-r " PACKAGES"
Remove the specified packages.  Packages specified as with --install.
.TP
.BI --rd " PACKAGES"
Similar to --remove|\-r but also remove all depending packages.
.TP
.BI --rp " PACKAGES"
Similar to --remove|\-r but also remove all prerequisite packages.
.TP
.B --ra
Remove all installed packages.
.TP
.BI --verify|\-V " NAME"
Verify that the permissions, ownership and file contents of the files
from the specified package have not been modified.
.TP
.BI --start " NAME"
Run any init scripts associated with the specified package with a
"start" argument.
.TP
.BI --stop " NAME"
Run any init scripts associated with the specified package with a
"stop" argument.
.TP
.BI --restart " NAME"
Run any init scripts associated with the specified package with a
"restart" argument.
.TP
.BI --reload " NAME"
Run any init scripts associated with the specified package with a
"reload" argument.
.TP
.BI --status " NAME"
Run any init scripts associated with the specified package with a
"status" argument.
.TP
.BI --start-all
Run the init scripts of all installed packages with a "start" argument.
.TP
.BI --stop-all
Run the init scripts of all installed packages with a "stop" argument.
.TP
.BI --restart-all
Run the init scripts of all installed packages with a "restart" argument.
.TP
.BI --reload-all
Run the init scripts of all installed packages with a "reload" argument.
.TP
.BI --exec-init
Run the init scripts associated with the specified packages. Requires
--init-cmd option to be specified.
.TP
.BI --init-script
Use with the --exec-init option to specify what packages to run the init
scripts.
.TP
.BI --init-cmd
Use with the --exec-init option to specify what init action to run.
.TP
.BI --query|\-q " NAMES"
Check if the specified packages are installed.
.B Tpkg
exit value will also indicate whether the package was found, so in
combination with --quiet this can be useful in scripts.
.TP
.BI --qs " NAME"
List packages on the server that match the specified name and are installable
on the current machine.
.TP
.B --qa
List all installed packages.
.TP
.B --qas
List all packages on the server.
.TP
.BI --qi " NAME"
Display info for the specified package.  Accepts the name of an installed
package or the filename of an uninstalled package.
.TP
.BI --qis " NAME"
Display info for the specified package on the server.
.TP
.BI --ql " NAME"
List the files in the specified package.  Accepts the name of an installed
package or the filename of an uninstalled package.
.TP
.BI --qls " NAME"
List the files in the specified package on the server.
.TP
.BI --qf " FILE"
List the package that owns the specified file.
.TP
.BI --qr " NAME"
List installed packages that depend on the specified package.
.TP
.BI --qd " NAME"
List the packages that the specified package depends on.  Accepts the name of
an installed package or the filename of an uninstalled package.
.TP
.BI --qd " NAME"
List the packages that the specified package on the server depends on.
.TP
.BI --dw " INTEGER"
The number of workers to use when deploying.  Defaults to 10. Only meaningful
when used with the servers option.
.TP
.BI --qX " NAME"
Display the tpkg.xml for the specified package.  Accepts the name of an
installed package or the filename of an uninstalled package.
.TP
.BI --qXs " NAME"
Display the tpkg.xml for the specified package on the server.
.TP
.BI --history
Display package installation history
.TP
.BI --qenv
Display machine's information such as OS and architecture.
.TP
.BI --qconf
Display tpkg's configuration settings.
.TP
.BI --base " BASE"
Base directory for tpkg operations.  Command line option overrides the
TPKG_HOME environment variable and config files.  The base directory must be a
fully qualified path.
.TP
.BI --source " SOURCE"
Specify additional sources where packages are located.
.TP
.BR --no-prompt | \-n
Turn off confirmation prompts.
.TP
.B --quiet
Reduce or eliminate informative but non-essential output.
.TP
.B --no-sudo
Normally
.B tpkg
will re-execute itself with sudo for operations that might need root
privileges.  This option disables that behavior.
.TP
.B --lock-force
.B Tpkg
locks the package database when performing install/upgrade/removal operations.
If tpkg is interrupted for some reason it might leave the lock file behind.
It will automatically remove lock files that are more than two hours old, this
option can be used to force immediate removal.
.TP
.B --force-replace
Replace the conflicting package(s) with the new one(s).
.TP
.B --force
Force the execution of a given task.
.TP
.BR --out | \-o
Output directory for the -m and --download option.
.TP
.B --skip-remove-stop
tpkg normally runs any init scripts in the target packages with a "stop"
argument on package removal. This option prevents that behavior. The init
script might be known to be broken, etc.
.TP
.BI --use-ssh-key " [KEY]"
Eliminate the prompt for an SSH password when deploying.  Specifying a
specific key file is optional.
.TP
.BI --deploy-as " USERNAME"
The user to use with SSH when deploying.  Defaults to the current user.
.TP
.BI --compress " [TYPE]"
What compression to use when making packages. Defaults to gzip. bz2 is the
other supported compression.  Setting the type to no will disable compression.
.TP
.B --debug
Print lots of messages about what
.B tpkg
is doing.
.TP
.B --version
Show the
.B tpkg
client version and exit.
.TP
.BR --help | \-h
Display the
.B tpkg
usage message and exit.

.SH FILES

.TP
.B /opt/tpkg
The default
.B tpkg
base.  Relocatable packages are installed relative to the base directory.
.B Tpkg
stores its package database, cache, etc. in BASE/var/tpkg.
.TP
.B /etc/tpkg.conf, $HOME/.tpkg.conf
Configuration file for
.B tpkg.
The home directory file overrides settings in the system-wide file.
.RS 8
.TP
.BI "base = " BASE
Set a different base other than /opt/tpkg.  The base directory must be a fully
qualified path.
.TP
.BI "source = " SOURCE
A URL or directory to use as a source of packages.  May be specified more than
once if more than one source of packages is available.  The directory must
have been prepared with the --extract option to create metadata.xml.
.TP
.BI "report_server = " URL
The URL for a
.B tpkg
reporting server.  If this is defined then all package install/upgrade/removal
operations will be reported to the server.
.TP
.BI "host_group_script = " FILENAME
The filename for a script which takes one or more host group names as
arguments and outputs the names of the hosts in those groups one per line on
stdout.  Used with the --group option.
.TP
.BI "sudo = " true/false
Should
.B tpkg
use sudo when performing package management operations?
.RE
.TP
.B /etc/tpkg/ca.pem
SSL certificate(s) needed to verify the
.B tpkg
server's identity. If
.B tpkg
is using a server with an https:// URL and if this file exists then
.B tpkg
will not proceed if the server's SSL certificate can't be verified against the
certs in this file.

.SH DIAGNOSTICS

See the
.B --debug
option.

.SH AUTHORS

.B Tpkg
is designed and maintained by Jason Heiss and Darren Dao.
